package com.example.demo.web.common.interceptor;

import lombok.extern.slf4j.Slf4j;
import org.noear.solon.annotation.Component;
import org.noear.solon.core.aspect.Interceptor;
import org.noear.solon.core.aspect.Invocation;
import org.noear.solon.core.handle.Context;

/**
 * @author airhead
 */
@Slf4j
@Component
public class LogInterceptor implements Interceptor {
  @Override
  public Object doIntercept(Invocation inv) throws Throwable {
    Context context = Context.current();
    String path = context.path();
    log.info("4. LogInterceptor, path: {}", path);

    return inv.invoke();
  }
}
